﻿<!DOCTYPE html>
<html>

<head id="Head1" runat="server">
  <title></title>
  <script src="/InSiteWebApplication/Scripts/array.pollyfill.js" type="text/javascript"></script>
  <script src="/InSiteWebApplication/Scripts/crypto-js.min.js" type="text/javascript"></script>
  <script src="/InSiteWebApplication/Scripts/secret.js" type="text/javascript"></script>
  <script src="/InSiteWebApplication/Scripts/dayjs.min.js" type="text/javascript"></script>
  <script type="text/javascript">
    function getParam(name) {
      try {
        var url = window.document.location.href;
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = url.split('?')[1].match(reg);
        if (r != null) {
          return r[2];
        }
        return "";
      } catch (e) {
        return "";
      }
    }
  </script>
</head>

<body>
  <!--[if lt IE 9]>
  <script type="text/javascript">
    var duration = dayjs().add(30, 'minute').format('YYYY-MM-DD HH:mm:ss');
    var host = window.location.host;
    var type = getParam("type");
    var employeeid = "";
    var url = "";
    var link = window.top.document.getElementById('feed_back_task') || window.top.document.getElementById('aProblemDeal');
    if (link !== null) {
      var href = link.href;
      var matchArr = href.match(/employeeid=([^&]+)/);
      if (matchArr && matchArr[1]) {
        employeeid = matchArr[1];
      }
    }

    if (type === 'check') {
      url = "http://" + host + "/InSiteWebApplication/forms/Custom/htmlPage/ContainerCheckVue3Page.html?uid=" + employeeid;
    }
    if (type === 'workreport') {
      url = "http://" + host + "/InSiteWebApplication/forms/Custom/htmlPage/ContainerStepWorkReportVue3Page.html?uid=" + employeeid + "&duration=" + Encrypt(duration);
    }

    var objShell = new ActiveXObject("WScript.Shell");
    var cmd = 'cmd.exe /c start chrome " ' + url;
    try {
      objShell.Run(cmd, 0, true);
    } catch (e) {
      window.open(url, '_self');
    }
    window.opener = null;
    window.open('', '_self');
    window.close();
  </script>
<![endif]-->

  <script type="text/javascript">
    var duration = dayjs().add(30, 'minute').format('YYYY-MM-DD HH:mm:ss');
    var host = window.location.host;
    var type = getParam("type");
    var employeeid = "";
    var url = "";
    var link = window.top.document.getElementById('feed_back_task') || window.top.document.getElementById('aProblemDeal');
    if (link !== null) {
      var href = link.href;
      var matchArr = href.match(/employeeid=([^&]+)/);
      if (matchArr && matchArr[1]) {
        employeeid = matchArr[1];
      }
    }
    if (type === 'check') {
      url = "http://" + host + "/InSiteWebApplication/forms/Custom/htmlPage/ContainerCheckVue3Page.html?uid=" + employeeid;
    }
    if (type === 'workreport') {
      url = "http://" + host + "/InSiteWebApplication/forms/Custom/htmlPage/ContainerStepWorkReportVue3Page.html?uid=" + employeeid + "&duration=" + Encrypt(duration);
    }
    window.open(url);
  </script>
</body>

</html>